<?php
/**
 * @version $Id: country.php 46 2011-09-27 10:42:49Z lnmtrung $
 */

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();


class WrdControllerUpgradeuser extends JControllerLegacy {	
	protected $option;
	protected $controller;
	
	function __construct( $default = array()){
		$this->option = 'com_wrd';
		$this->controller = 'upgradeuser';
		parent::__construct( $default );
	}

	function display(){
		JRequest::setVar( 'hidemainmenu', 0 );
		JRequest::setVar( 'view'  , 'upgradeuser');
		parent::display();
	}
	
	function publish(){
		$id = &JRequest::getVar('id');
		$db = &JFactory::getDbo();
		
		$query = 'UPDATE #__users set block = 1 where id ='.$id;
		//echo $query;
		$db->setQuery($query)->query();
		echo 'publish';
		exit();
	}
	
	function unpublish(){
		$id = &JRequest::getVar('id');
		$db = &JFactory::getDbo();
		
		$query = 'UPDATE #__users set block = 0 where id ='.$id;
		//echo $query;
		$db->setQuery($query)->query();
		echo 'unpublish';
		exit();
	}
}